package command.party;

import javax.sound.midi.Soundbank;
import java.util.logging.Level;

/**
 * @author by liutl
 * @date 2018/8/1 22:10
 */
public class Light {
    String location;
    int leval;

    public Light(String location) {
        this.location = location;
    }

    public void on() {
        leval = 100;
        System.out.println("Light is on");
    }

    public void off() {
        leval = 0;
        System.out.println("Light is off");
    }


    /**
     * 调暗
     *
     * @param leval
     */
    public void dim(int leval) {
        this.leval = leval;
        if (leval == 0) {
            off();
        } else {
            System.out.println("Light is dimmed to " + leval + "%");
        }
    }

    public int getLeval() {
        return leval;
    }
}
